package net.thermetics.fx.controllers;

import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/dashboard")
@Secured("ROLE_USER")
public class DashboardController extends AbstractController {
	@RequestMapping(method = RequestMethod.GET)
	public String renderDashboard(Model model) {
		model.addAttribute("userID", super.currentUser.getPrincipal().getUserId());
		model.addAttribute("apiKey", super.currentUser.getPrincipal().getApiKey());
		return "dashboard";
	}
}
